home *** CD-ROM | disk | FTP | other *** search
/ How Many Bugs in a Box / How Many Bugs in a Box.cdr / bugs / act4 / 00073.ls < prev    next >
Encoding:
Text File  |  1995-04-05  |  2.6 KB  |  81 lines

  1. on exitFrame
  2.   global correctanim, masterlist, mastercounter, level1, kingcolor, NumofCol, origsprites, steplimit, mycolor, CurrentBug
  3.   unLoad("bug" & CurrentBug & level1, ("bug" & CurrentBug & level1) + 2)
  4.   set mycolor to 0
  5.   puppetSprite(48, 0)
  6.   cursor(-1)
  7.   if level1 = 1 then
  8.     set offset to 0
  9.     set hinter to 1
  10.   else
  11.     set hinter to 2
  12.     set offset to 10
  13.   end if
  14.   if correctanim = [] then
  15.     set correctanim to [1, 2, 3, 4]
  16.   end if
  17.   set mycorrect to getAt(correctanim, random(count(correctanim)))
  18.   deleteAt(correctanim, getPos(correctanim, mycorrect))
  19.   play frame "L" & hinter & ".Correct" & mycorrect
  20.   if level1 = 1 then
  21.     set loopcounter to [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
  22.     set holdme to []
  23.     repeat with xxx = 1 to 4
  24.       add(holdme, the castNum of sprite (xxx + 37))
  25.     end repeat
  26.     startTimer()
  27.     set timelimit to the timer + 180
  28.     set numberoftimes to 0
  29.     puppetSound(0)
  30.     puppetSound("rewsong" & random(3))
  31.     repeat while the soundBusy of 1 or (numberoftimes < 5)
  32.       set ptime to the timer
  33.       repeat with xxx = 1 to NumofCol
  34.         set counter to getAt(loopcounter, xxx)
  35.         set dissprite to xxx + 37
  36.         set holdlist to getAt(origsprites, xxx)
  37.         set discan to getAt(holdlist, 1)
  38.         set moveinfo to getAt(getAt(masterlist, offset + discan), counter)
  39.         set the castNum of sprite dissprite to getAt(moveinfo, 1)
  40.         set the locH of sprite dissprite to getAt(holdlist, 2) + getAt(moveinfo, 2)
  41.         set the locV of sprite dissprite to getAt(holdlist, 3) + getAt(moveinfo, 3)
  42.         if counter = getAt(steplimit, xxx) then
  43.           setAt(loopcounter, xxx, 0)
  44.         end if
  45.         repeat while (the timer - ptime) < 5
  46.           updateStage()
  47.         end repeat
  48.       end repeat
  49.       if the mouseDown then
  50.         exit repeat
  51.       end if
  52.       updateStage()
  53.       set loopcounter to loopcounter + 1
  54.       set numberoftimes to numberoftimes + 1
  55.     end repeat
  56.     puppetSound(0)
  57.     repeat with xxx = 1 to NumofCol
  58.       set dissprite to xxx + 37
  59.       set holdlist to getAt(origsprites, xxx)
  60.       set discan to getAt(holdlist, 1)
  61.       set the castNum of sprite dissprite to getAt(holdme, xxx)
  62.       set the locH of sprite dissprite to getAt(holdlist, 2)
  63.       set the locV of sprite dissprite to getAt(holdlist, 3)
  64.     end repeat
  65.     updateStage()
  66.   else
  67.     repeat with xxx = 38 to 48
  68.       puppetSprite(xxx, 0)
  69.     end repeat
  70.     play frame "tencansjump"
  71.   end if
  72.   puppetSound(0)
  73.   puppetSprite(1, 0)
  74.   play frame "Close.L" & hinter
  75.   repeat with xxx = 38 to 47
  76.     puppetSprite(xxx, 0)
  77.   end repeat
  78.   puppetSprite(37, 1)
  79.   go("main")
  80. end
  81.